package com.originskyseed.platform.user.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.originskyseed.platform.user.model.PlayerRelateViewLive;

/**
 * 玩家观看直播信息表Mapper类（OSI_PLAYER_RELATE_VIEW_LIVE）
 * 
 * @author Tangwanghui
 */
public interface PlayerRelateViewLiveMapper {

	/**
	 * 删除记录
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKey(String id) throws Exception;

	/**
	 * 批量删除记录
	 * 
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * 插入记录
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insert(PlayerRelateViewLive record) throws Exception;

	/**
	 * 插入记录（仅非空值字段）
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insertSelective(PlayerRelateViewLive record) throws Exception;

	/**
	 * 更新记录
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKey(PlayerRelateViewLive record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKeySelective(PlayerRelateViewLive record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateMonthByPrimaryKeySelective(PlayerRelateViewLive record) throws Exception;


	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public int updateByPlayerIdAndChannelTime(Map<String, Object> params) throws Exception;

	/**
	 * 查询记录
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public PlayerRelateViewLive selectByPrimaryKey(String id) throws Exception;

	/**
	 * 查询记录
	 * 
	 * @param playerId
	 * @return
	 * @throws Exception
	 */
	public Integer selectStandardViewLiveByPlayerId(@Param("playerId") String playerId, @Param("registerTime") String registerTime) throws Exception;

	/**
	 * 查询列表
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public List<PlayerRelateViewLive> selectList(PlayerRelateViewLive record) throws Exception;


	/**
	 * 查询记录
	 *
	 * @param liveId
	 * @return
	 * @throws Exception
	 */
	public PlayerRelateViewLive selectByLiveId(@Param("liveId") String liveId) throws Exception;

	/**
	 * 分页查询列表
	 * 
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<PlayerRelateViewLive> selectListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 批量插入
	 *
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public int insertBatch(@Param("list") List<PlayerRelateViewLive> list) throws Exception;

	/**
	 * 批量插入
	 *
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public int insertMonthBatch(@Param("list") List<PlayerRelateViewLive> list) throws Exception;

	/**
	 * 分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<PlayerRelateViewLive> selectListRelAnchorByPage(Map<String, Object> params) throws Exception;

	/**
	 * 查询观看人数
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public Integer selectWatchNumber(Map<String, Object> params) throws Exception;

	/**
	 * 更新记录,根据子渠道id和分隔时间
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public int updateByChannelSubId(Map<String, Object> params) throws Exception;


	/**
	 * 查询观看直播玩家的数量
	 * @param anchorId
	 * @return
	 * @throws Exception
	 */
	public Integer selectPlayerNumByAnchorId(@Param("anchorId") String anchorId) throws Exception;
}